package com.onesports.intelligent.k12.polarlight.service.course;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.onesports.framework.kit.common.util.BeanUtils;
import com.onesports.framework.kit.common.util.ParamUtils;
import com.onesports.intelligent.k12.polarlight.domain.entity.course.CourseScheduleDetail;
import com.onesports.intelligent.k12.polarlight.domain.entity.course.SpellingClassDetails;
import com.onesports.intelligent.k12.polarlight.domain.vo.course.CourseScheduleDetailVO;
import com.onesports.intelligent.k12.polarlight.domain.vo.student.StudentAttendanceVO;
import com.onesports.intelligent.k12.polarlight.enums.ScheduleDetailStatusEnum;
import com.onesports.intelligent.k12.polarlight.mapper.course.CourseScheduleDetailMapper;
import com.onesports.intelligent.k12.polarlight.mapper.course.SpellingClassDetailsMapper;
import com.onesports.intelligent.k12.polarlight.service.student.StudentAttendanceService;
import com.onesports.intelligent.k12.polarlight.service.student.UserStudentRelService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @author Wsy
 **/
@Service
@RequiredArgsConstructor
public class CourseScheduleDetailManager extends ServiceImpl<CourseScheduleDetailMapper, CourseScheduleDetail> {

    private final CourseScheduleDetailMapper scheduleDetailMapper;


    /**
     * 根据课表id获取详情
     *
     * @param scheduleIds 课表ids
     * @return List<CourseScheduleDetail>
     */
    public List<CourseScheduleDetail> listByScheduleIds(List<String> scheduleIds) {
        return this.list(new LambdaQueryWrapper<CourseScheduleDetail>()
                .in(CourseScheduleDetail::getScheduleId, scheduleIds));
    }

    /**
     * 获取课表时段信息
     *
     * @param scheduleId 课表id
     * @param campusIds  校区ids
     * @param courseId   课程id
     * @param startDate  开始日期
     * @param endDate    结束日期
     * @param coachId    教练id
     * @return List<CourseScheduleDetailVO>
     */
    public List<CourseScheduleDetailVO> schedulePreview(String scheduleId, List<String> campusIds, String courseId, String startDate, String endDate, String coachId) {
        return this.scheduleDetailMapper.schedulePreview(scheduleId, campusIds, courseId, startDate, endDate, coachId);
    }



}
